<?php
namespace Home\Model;
use Think\Model;
class DeviceModel extends Model {
    public function getDeviceList($cond=null){
    	$res = M('device')->where($cond)
    		->select();
    	return $res;
    }
    
    public function insertDeviceInfo($data){
    	if(!$data){
    		return false;
    	}
    	$res = M('device')->add($data);
    	return $res;
    }
    
    public function getDeviceInfo($cond){
    	if(!$cond){
    		return false;
    	}
    	$res = M('device')->where($cond)
    		->find();
    	return $res;
    }
    
    public function reviseDeviceInfo($cond,$data){
    	if(!$cond || !$data){
    		return false;
    	}
    	$res = M('device')->where($cond)
    		->save($data);
    	return $res;
    
    	
    }
}